<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Text to Unicode Convertor</title>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>

<script type="text/javascript">  

	$(document).ready(function(){
		$('.error').hide();

		$('.note').toggle(function() {
		  $('#swapList').show();
		}, function() {
		  $('#swapList').hide();
		});
		
		$("#submit").click(function(){
		$('.error').hide();	
		 var conv = $("#textconvert").val();
		 if (conv == "") {
	     	$("label#conv_error").show();
	      	return false;
	     }

			$.ajax({
		      type: "POST",
		      url: "entity-convert.php",
		      processData: false,
		      data: $("#convertForm").serialize(),
		      success: function(responseText) {
			        $('#formResponse').empty(responseText);
			    	$('#formResponse').append(responseText);      
			    }
		     });
	    return false;
		});
	}); 
  
</script>


<style type="text/css">
<!--
body {
	font-family: Helvetica, Verdana, Arial, sans-serif; 
	font-size:.9em;

}

label { 
	 
	float: left; 
	text-align: left;
	color: #ff3366;
	margin-right: 5px;
}

.error {
	color: red; 
	vertical-align: top; 
	font-weight: bold;
	padding-top: 5px;
	padding-bottom: 5px;
	width: 500px;
	clear: both;
}

#convertContainer {
	width: 500px;
}

p { 
	font-family: Helvetica, Verdana, Arial, sans-serif; 
	clear: both; 
	margin-bottom: 5px;
	margin-top: 12px;
}
 
.note {
	font-size: 10px;
	cursor: pointer;
}

.inputBox {
	width: 500px;
	float: left;
	margin-bottom: 5px;
}

.fltRight {
	float: right;
}

#formResponse {
	margin-top: 10px;
}

#swapList {
	font-size: 11px;
	display: none;
}

li {
	list-style-type: none;
}



-->
</style>


</head>
<body>


<div id="convertContainer">
<h1>Text to Unicode Converter</h1>
<form action="" method="post" id="convertForm">
<!--<p>
	<label for="punctuation"><strong>Convert punctuation as well (<i>for emails</i>):</strong></label>
	<input name="punctuation" type="checkbox" value="yes" />
</p>-->

<p>
	<label for="safepunctuation"><strong>Safe punctuation (<i>for email clients</i>):</strong></label>
	<input name="safepunctuation" id="safepunctuation" type="checkbox" value="yes" checked="checked" /><br />
	<small class="note">This swaps some returned characters to safer versions, eg; &amp;#8220; to &amp;#34; Click to see all swaps.</small>
	<div id="swapList">
		<ul>
			<li>&amp;#8220; to &amp;#34;</li>
			<li>&amp;#8221; to &amp;#34;</li>
			<li>&amp;#8216; to &amp;#39;</li>
			<li>&amp;#8217; to &amp;#39;</li>
			<li>&amp;#8211; to &amp;#45;</li>
			<li>&amp;#8212; to &amp;#45;</li>
		</ul>
	</div>
</p>

<p>
	<label for="textconvert"><strong>Enter your text to convert:</strong></label><br />
	<textarea name="textconvert" id="textconvert" cols="60" rows="18" class="inputBox"></textarea>
	<label class="error" for="textconvert" id="conv_error">This field is required. Please enter something to convert!</label>
</p>
<p>	
	<input id="submit" name="Convert" type="submit" value="Convert" class="fltRight"/>
</p>
</form>
</div>

<div id='formResponse'></div>

</body>
</html>
